# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=gxr
pkgver=0.16.0
pkgrel=0
pkgdesc="A glib wrapper for the OpenVR and the OpenXR APIs"
url="https://gitlab.freedesktop.org/xrdesktop/gxr"
arch="all"
license="MIT AND CC-BY-SA-4.0"
depends_dev="
	json-glib-dev
	openxr-dev
	"
makedepends="$depends_dev
	cmd:glslangValidator
	gtk-doc
	gtk+3.0-dev
	gulkan-dev
	meson
	"
subpackages="$pkgname-doc $pkgname-dev"
source="https://gitlab.freedesktop.org/xrdesktop/gxr/-/archive/$pkgver/gxr-$pkgver.tar.gz"

build() {
	abuild-meson \
		-Dapi_doc=true \
		-Dexamples=false \
		-Dtests=true \
		. output
	meson compile -C output
}

check() {
	# The XR tests require a working VR setup
	meson test --no-rebuild --print-errorlogs -C output --no-suite gxr:xr --no-suite post-install
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
6809995be9b5b726237a2fa02f96b63beb04b4e3ad2cb52b72753d2a62c156a4c74cc63028e888c0cb4fde37bc140872ee69551db807dec17330ea7798cabfe2  gxr-0.16.0.tar.gz
"
